package com.mt.restaurant.entity.staff;

import javax.persistence.*;
import java.io.Serializable;
import com.mt.common.core.annotation.DColumn;
import com.mt.common.core.annotation.DEntity;
import com.mt.common.core.web.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;



import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.ser.std.DateSerializer;
import com.mt.restaurant.entity.staff.Staff;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

@DEntity(label="出勤记录",comment="",moduleLabel="员工管理")
@Entity(name="restaurant_staff_attendance_records")
@Table(name = "restaurant_staff_attendance_records" , indexes = { @Index(name = "index_staff_id", columnList = "staff_id"),@Index(name = "index_status", columnList = "status")  })
@ApiModel(description = "出勤记录:")
public class StaffAttendanceRecords extends BaseEntity implements Serializable{
	private static final long serialVersionUID = 1L;

	@DColumn(index=3,label="员工",foreignEntity="Staff",comment="名称",component="对象选择",where=true)
	@ApiModelProperty(value = "员工:名称")
	@Column(name="staff_id",length=255,nullable=false,unique=false)
	private Long staffId;

	@Transient
	private Staff staff;

	@Transient
	@ApiModelProperty(value = "员工名称:名称")
	@DColumn(index=3,label="员工",foreignEntity="Staff",comment="名称")
	private String staffName;

	@DColumn(index=4,label="状态",codeTable="出勤状态",codeTableOptions="请假,旷工,迟到,正常",comment="出勤状态",component="字典下拉单选",where=true)
	@ApiModelProperty(value = "状态:出勤状态")
	@Column(name="status",length=255,nullable=false,unique=false)
	private String status;

	@DColumn(index=5,label="出勤时间",comment="",component="日期选择",where=true)
	@ApiModelProperty(value = "出勤时间:")
	@Column(name="date",length=255,nullable=true,unique=false)
	@JsonSerialize(using = DateSerializer.class)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date date;


	public Long getStaffId() {
		return this.staffId;
	}

	public void setStaffId(Long staffId) {
		this.staffId = staffId;
	}

	@Override
	public String getStatus() {
		return this.status;
	}

	@Override
	public void setStatus(String status) {
		this.status = status;
	}

	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Staff getStaff() {
		return this.staff;
	}

	public void setStaff(Staff staff) {
		if(staff == null){
		}
		else
		{
		this.staffId = staff.getEid();
		this.staff = staff;		
		}
}

	public String getStaffName() {
		return this.staffName;
	}

	public void setStaffName(String staffName) {
		this.staffName = staffName;
	}



}
